package com.peaksport.pkms.leanrtest1.controller;

import javax.ws.rs.core.MediaType;

import org.apache.servicecomb.provider.rest.common.RestSchema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.peaksport.framework.base.controller.BaseController;
import com.peaksport.framework.exception.PKDevException;
import com.peaksport.pkms.leanrtest1.service.TestPackTcc1Service;

@RestSchema(schemaId="pkms-test1-pack-tcc")
@RequestMapping(value="test1/pack/tcc",produces=MediaType.APPLICATION_JSON)
public class TestPackTcc1Controller extends BaseController {
	
	@Autowired
	private TestPackTcc1Service service;
	
	@GetMapping("tesAuditBillEtryForTcc")
	public String testAuditBillEntryForTcc(@RequestParam String billId,
			@RequestParam boolean isException,@RequestParam boolean isExceptionInConfirm,@RequestParam boolean isExceptionInCancel) {
		billId =urlDecode(billId);
		service.auditBillEntryForTcc(billId,isException,isExceptionInConfirm,isExceptionInCancel);
		if (true) throw PKDevException.throwException("审核分录在controller中，执行micservice2后发生异常.");
		return "审核分录成功";
	}
}
